<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="st" uri="http://www.springframework.org/tags"%>

<%@ taglib uri="http://www.springframework.org/tags/form" prefix="sf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>扑通扑通</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<c:set var="ctx" value="" />
<link rel="stylesheet"
	href="${ctx}/static/resource/css/theme.css?version=0.1">
<script src="${ctx}/static/resource/js/jquery-2.2.4.min.js"></script>
<script type="text/javascript">
	$(function() {

		$("#orderconfirm").click(function() {
			var contacttel = $("#contacttel").val();
			if (!(/^0?1[3|4|5|8][0-9]\d{8}$/.test(contacttel))) {
				alert("请输入有效的手机号");
				return false;
			}

			var contactname = $("#contactname").val();
			if(contactname==""){
				alert("请填写联系人！");
				return false;
			}

			$("#orderconfirmform").submit();

		});

	});
</script>
</head>

<body class="bg-gray">
<div class="wrapper">
	<form id="orderconfirmform" method="post"
		action="${ctx}/qt/ordersave.do">
		<div class="wrapper">
			<address>
				<h2>*送货地址</h2>
				<div style="color: red">*友情提示:现在我们仅限提供下述地区送餐服务，其他地区送餐服务正在计划中，敬请期待</div>
				<div class="order-box">
					<select id="shopname" name="shopname" style="width:100%">
						<c:forEach var="shop" items="${shoplist}">
							<option value="${shop}">${shop}</option>
						</c:forEach>
					</select>
				</div>
			</address>

			<div class="order-box">
				<ul>
					<li>*联系电话 <input type="tel" id="contacttel"
						name="contacttel" /></li>
				</ul>
			</div>
			<div class="order-box">
				<ul>
					<li>*联系人 <input  type="text" id="contactname"
						name="contactname" /></li>
				</ul>
			</div>
			<div class="order-box">
				<ul>
					<li>备注 <textarea name="memop" class="ord-input" rows="2"
							placeholder="（选填）可输入特殊要求"></textarea></li>
				</ul>
			</div>
			<div class="order-box">
				<table>
					<c:forEach var="huoguo" items="${dish.huoguolist}">
						<tbody>
							<tr>
								<th>${huoguo.name}</th>
								<td>${huoguo.no}份</td>
								<td>¥${huoguo.price}</td>
							</tr>
						</tbody>
					</c:forEach>
					<c:forEach var="rou" items="${dish.roulist}">
						<tbody>
							<tr>
								<th>${rou.name}</th>
								<td>${rou.no}份</td>
								<td>¥${rou.price}</td>
							</tr>
						</tbody>
					</c:forEach>
					<c:forEach var="yinliao" items="${dish.yinliaolist}">
						<tbody>
							<tr>
								<th>${yinliao.name}</th>
								<td>${yinliao.no}份</td>
								<td>¥${yinliao.price}</td>
							</tr>
						</tbody>
					</c:forEach>

					<tfoot>
						<tr>
							<th colspan="3" class="text-right">总计 ¥ ${totalprice}</th>
						</tr>
					</tfoot>
				</table>
			</div>
			<footer> <!-- 	<div>
			<h2>
				还需付 <span>¥29</span>
			</h2>
		</div> -->
			<button id="orderconfirm">确认下单</button>
			</footer>
		</div>

		<input type="hidden" id="openid" name="openid" value="${openid}">
	</form>
	</div>
</body>
</html>